﻿<Page
    x:Class="UIThreadExample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UIThreadExample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.DataContext>
            <local:ViewModel/>
        </Grid.DataContext>
        <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
            <Button Command="{Binding}" CommandParameter="correct">Refresh on UI Thread</Button>
            <Button Command="{Binding}" CommandParameter="incorrect">Refresh on Background Thread</Button>
        </StackPanel>
        <TextBlock Text="{Binding Time}" Grid.Row="1" FontSize="40" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
    </Grid>
</Page>
